﻿@model Customer
@section ToolBar{}

<div class="l-m-form">
    <form mark="LedinghuoForm" action="@Url.Action("Edit")" method="POST">
        @Html.LEditorFor(m => m.CustomerNo, Html.TextBoxFor, false)
        @Html.LEditorFor(m => m.CustomerName, Html.TextBoxFor, false)
        @Html.LEditorFor(m => m.FullName, Html.TextBoxFor, false)
        @Html.LEditorFor(m => m.ContactName, Html.TextBoxFor, false)
        @Html.LTextEditAreaFor(m => m.AreaId, new { req = new { message = "请选择区域" } }, null)

        <div class="form-item">
            <div class="label c5">负责人</div>
            <div class="req">*</div>
            <div class="content">
                @Html.LTextEdit("EmployeeBox", (Model.Employee != null) ? Model.Employee.EmployeeName : "", "EmployeeId", "text", new { data = Model.EmployeeId, @class = "inp-text bc1 bgc0 inp-lg7 inp-hg6 commonbox", fa = "fa-angle-down" }, new { req = new { message = "负责人不允许空" } }, null)
            </div>
        </div>
        <div class="form-item">
            <div class="label c5">客户等级</div>
            <div class="req">*</div>
            <div class="content">
                @Html.LTextEdit("CustomerLevelBox", (Model.CustomerLevel != null) ? Model.CustomerLevel.CustomerLevelName : "", "CustomerLevelId", "text", new { data = Model.CustomerLevelId, @readonly = "readonly", @class = "inp-text bc1 bgc0 inp-lg7 inp-hg6 commonbox", fa = "fa-angle-down" }, new { req = new { message = "客户等级不允许空" } }, null)
            </div>
        </div>
        <div class="form-item">
            <div class="label c5">企业类别</div>
            <div class="req">*</div>
            <div class="content">
                @Html.LTextEdit("CompanyTypeBox", Model.CompanyTypeId.GetEnumDescription(), "CompanyTypeId", "text", new { data = (long)Model.CompanyTypeId, @readonly = "readonly", @class = "inp-text bc1 bgc0 inp-lg7 inp-hg6 commonbox", fa = "fa-angle-down" }, new { req = new { message = "企业类别不允许空" } }, null)
            </div>
        </div>
        @Html.LEditorFor(m => m.Mb, Html.TextBoxFor)
        @Html.LEditorFor(m => m.Email, Html.TextBoxFor)
        @Html.LEditorFor(m => m.Phone, Html.TextBoxFor)
        <div class="form-item">
            <div class="label c5">地址</div>
            <div class="content">
                @Html.LTextEdit("Address", Model.Address, new { @class = "inp-text bc1 bgc0 inp-lg10 inp-hg6 mapaddress" },null,null)
            </div>
        </div>
        @Html.LEditorFor(m => m.Remark, Html.TextAreaFor)
        @Html.LButton("保存")
        <input type="hidden" name="X" id="X" value="@Model.X" />
        <input type="hidden" name="Y" id="Y" value="@Model.Y" />
        <input type="hidden" name="IsMapped" id="IsMapped" value="@Model.IsMapped" />
    </form>
    @Html.LPageError()
</div>
<script type="text/javascript">
    $(function () {
        $.area();
        //企业类别
        $("#CompanyTypeBox").companyType(function ($this) {
            $("#CompanyTypeId").val($this.attr("data")).input().doVerification();
        });
        //负责人
        $("#EmployeeBox").employee(function ($this) {
            $("#EmployeeId").val($this.attr("data")).input().doVerification();
        });
        //客户等级
        $("#CustomerLevelBox").customerLevel(function ($this) {
            $("#CustomerLevelId").val($this.attr("data")).input().doVerification();
        });

        $("a[mark=MapAddree]").bind("click", function () {
            $.LWindow({
                title: "地图",
                id: "Window-Map",
                width: 1024,
                height:500,
                url: "/Customer/MapAddress",
                callback: function () {

                }
            });
        });
    });
</script>